bd466fe39de25e193dc87cdb83147ca8e598aa82,src/test/java/org/elasticsearch/test/integration/search/query/SimpleQueryTests.java,SimpleQueryTests,typeFilterTests,#String#,277

Before Change


                        .endObject().endObject())
                .execute().actionGet();

        client().prepareIndex("test", "type1", "1").setSource("field1", "value1").execute().actionGet();
        client().prepareIndex("test", "type2", "1").setSource("field1", "value1").execute().actionGet();
        client().admin().indices().prepareFlush().execute().actionGet();

        client().prepareIndex("test", "type1", "2").setSource("field1", "value1").execute().actionGet();
        client().prepareIndex("test", "type2", "2").setSource("field1", "value1").execute().actionGet();
        client().prepareIndex("test", "type2", "3").setSource("field1", "value1").execute().actionGet();

After Change


                        .startObject("_type").field("index", index).endObject()
                        .endObject().endObject())
                .execute().actionGet();
        indexRandom("test", true, 
            client().prepareIndex("test", "type1", "1").setSource("field1", "value1"),
            client().prepareIndex("test", "type2", "1").setSource("field1", "value1"),
            client().prepareIndex("test", "type1", "2").setSource("field1", "value1"),
            client().prepareIndex("test", "type2", "2").setSource("field1", "value1"),
            client().prepareIndex("test", "type2", "3").setSource("field1", "value1"));

        assertThat(client().prepareCount().setQuery(filteredQuery(matchAllQuery(), typeFilter("type1"))).execute().actionGet().getCount(), equalTo(2l));
        assertThat(client().prepareCount().setQuery(filteredQuery(matchAllQuery(), typeFilter("type2"))).execute().actionGet().getCount(), equalTo(3l));